package com.bosssoft.trainee.nontax.util.mapper.poDto;

import com.bosssoft.trainee.nontax.entity.dto.RoleDto;
import com.bosssoft.trainee.nontax.entity.po.Role;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;

import java.util.List;

/**
 * @Description: role dto po transform util class
 * @Author: Luo WenLong
 * @Date: 2022/6/25 9:03
 */
@Mapper(componentModel = "spring")
public interface RolePoDto {

    /**
     * @Description: po to dto
     * @param role role
     * @return: com.bosssoft.trainee.nontax.entity.dto.RoleDto
     * @Author: Luo WenLong
     * @Date: 2022/6/25 9:05
     */
    RoleDto po2dto(Role role);

    /**
     * @Description: po to dto
     * @param roles role list
     * @return: java.util.List<com.bosssoft.trainee.nontax.entity.dto.RoleDto>
     * @Author: Luo WenLong
     * @Date: 2022/6/25 9:05
     */
    List<RoleDto> po2dto(List<Role> roles);

    /**
     * @Description: dto to po
     * @param roleDto role
     * @return: com.bosssoft.trainee.nontax.entity.po.Role
     * @Author: Luo WenLong
     * @Date: 2022/6/25 9:06
     */
    @Mappings({
            @Mapping(target = "updateTime", source = "")
    })
    Role dto2po(RoleDto roleDto);

    /**
     * @Description: dto to po
     * @param roleDtos role list
     * @return: java.util.List<com.bosssoft.trainee.nontax.entity.po.Role>
     * @Author: Luo WenLong
     * @Date: 2022/6/25 9:06
     */
    List<Role> dto2po(List<RoleDto> roleDtos);
}
